<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
request.setCharacterEncoding("UTF-8");
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <base href="<%=basePath%>">
<title>额度控制</title>

<jsp:include page="/WEB-INF/jsp/common/common.jsp"></jsp:include>

<script src="js/jquery.divbox.js" type="text/javascript"></script>
<script>
	history.forward();
	
	$(document).ready(function() {
		isReadyIframe();
		queryCreditLmtDef(1);
		$("#selfOnly").click(function(){
			if($("#selfOnly").prop("checked")){
				if(confirm("额度信息仅控制本部，不控制合作伙伴子机构额度，确认添加？")){
					$("#selfOnly").prop("checked", true);
				}else{
					$("#selfOnly").prop("checked", false);
				}
			} 
		});
	});
	
	function isReadyIframe(){
		var iframe = $(window.parent.document).find("#iframe").length;
		if(iframe==0){
			window.location.href="<%=basePath%>index.jsp";
		}
	}

	//"新增"层，加载channelInfo下拉框(只加载没有“creditLmtDef”的“channelInfo”)
// 	function loadChannelInfoSelect_addOrUpdateDiv(){
// 		$.ajax({
<%-- 				url : "<%=path%>/creditLmtControl/queryNotInCreditLmtDefChannelInfo?"+new Date().getTime(), --%>
// 				type : 'POST',
// 				async : true,
// 				dataType:'json',
// 				success : function(data) {
					
// 					if($.validate(data))  return;
// 					//业务处理
// 					//channelInfo下拉框对象
// 					var channelInfoSelect_addOrUpdateDiv = document.getElementById("channelInfoSelect_addOrUpdateDiv");
				
// 					channelInfoSelect_addOrUpdateDiv.options.length = 0;
// 					if (data != null) {
// 						for (var i = 0; i < data.length; i++) {
// 							var option = new Option();
// 							option.text = data[i].channelName;
// 							option.value = data[i].channelCode;
// 							channelInfoSelect_addOrUpdateDiv.add(option);
// 						}
// 					}else{
// 						var option = new Option();
// 						option.text = "无可选合作伙伴！";
// 						option.value = "";
// 						channelInfoSelect_addOrUpdateDiv.add(option);
// 					}
// 				}
// 			});
// 	 }
	
	//点击“查询”(creditLmtDef)
	function queryCreditLmtDef(pageIndex){
		$.openLoading();
		
		var channelName = $("#channelName").val();
		//按照条件执行查询操作
		$.ajax({
			url : "<%=path%>/creditLmtControl/queryCreditLmtDefByChannelName?"+new Date().getTime(),
			type : 'POST',
			async : true,
			data:{
				channelName:channelName,
				pageIndex:pageIndex
			},
			dataType:'json',
			success:function(data){
				$.closeLoading();
				
				if($.validate(data))  return;
				if(null != data){//业务处理
					var buttonStr = "<a href='' onClick='updateCreditLmtDef(this);return false'>编辑</a> <a href='' onClick='delCreditLmtDef(this);return false'>删除</a> <a href='' onClick='appendMoney(this);return false'>追加保费</a> <a href='' onClick='appendDetail(this);return false'>明细查看</a>";
					var fieldNames = "LIMIT_NO@TDH,CHANNEL_NAME,SAVE_MONEY,SUM_APPEND_MONEY,ALERT_LMT,TERMINAL_LMT,CHANNEL_CODE@TDH,SELF_ONLY@TDH,PARENT_CHANNEL_CODE@TDH";
					var tableContent = creatTable(fieldNames,data,buttonStr);
					var tableObj = $("#creditLmtDefTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
					var strPage = creatChannelPage(pageIndex,6,data.maxPage,"10");
					var pageDIV = $("#creditLmtDefPageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
				}
			}
		});
	}
	
	//点击“删除”(creditLmtDef)
	function delCreditLmtDef(creditLmtDef){
		
		$.dialog({
			type: "warn",//success,error
			content: "您确定要删除该条记录吗？",
			onOk: function() {
				var limitNo = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[0].innerHTML;
				var channelCode = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[6].innerHTML;
				$.openLoading();
				
				$.ajax({
					url : "<%=path%>/creditLmtControl/delCreditLmtDefByCreditLmtDef?"+new Date().getTime(),
					type : 'POST',
					async : true,
					data:{
						limitNo:limitNo,
						channelCode:channelCode
					},
					dataType:'json',
					success:function(data){
						$.closeLoading();
						
						if($.validate(data))  return;
						
						queryCreditLmtDef(1);
// 						loadChannelInfoSelect_addOrUpdateDiv();
					}
				});
			}
		});
	}

	//点击"追加保费"
	function appendMoney(creditLmtDef){
		var limitNo = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[0].innerHTML;
		var channelName = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[1].innerHTML;
		var saveMoney = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[2].innerHTML;
		var alertLmt = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[4].innerHTML;
		var terminalLmt = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[5].innerHTML;
		var channelCode = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[6].innerHTML;
		
		$("#limitNo_appendMoney").val(limitNo);
		$("#channelCode_appendMoney").val(channelCode);
		$("#channelName_appendMoney").val(channelName);
		$("#alertLmt_appendMoney").val(alertLmt);
		$("#terminalLmt_appendMoney").val(terminalLmt);
		$("#saveMoney_appendMoney").val(saveMoney);
		
		$("#appendMoneyDiv").OpenDiv();
	}
	
	//保存“追加保费”
	function saveAppendMoney(){
		var appendMoney = $.trim($("#appendMoney").val());
		var remarkDscp = $.trim($("#remarkDscp").val());
		if(appendMoney == ""){

			$.message("error", "追加保费不能为空");
			
			return;
		}else if(!isNum(appendMoney)){
			$.message("error", "追加保费必须为数字");
			
			return;
		}
		if(remarkDscp ==""){
			$.message("error", "备注说明不能为空");
			return;
		}
		
		var limitNo = $("#limitNo_appendMoney").val();
		var channelCode = $("#channelCode_appendMoney").val();
		var saveMoney = $("#saveMoney_appendMoney").html();
		
		$.openLoading();
		$.ajax({
			url : "<%=path%>/creditLmtControl/saveAppendMoney?"+new Date().getTime(),
			type : 'POST',
			async : true,
			data:{
				limitNo:limitNo,
				partnerCode:channelCode,
				appendMoney:appendMoney,
				remarkDscp:remarkDscp
			},
			dataType:'json',
			success:function(data){
				$.closeLoading();
				
				if($.validate(data))  return;
				closeAppendMoneyDiv();
				
				queryCreditLmtDef(1);
// 				loadChannelInfoSelect_addOrUpdateDiv();
			}
		});
		
	}
	var temLimtNo="";
	//点击追加明细
	function appendDetail(creditLmtDef){
		temLimtNo = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[0].innerHTML;
		queryAppendDetail(1);
	}
	function queryAppendDetail(pageIndex){
		$.openLoading();
		var beginTime = $("#handelDateBegin").val();
		var endTime = $("#handelDateEnd").val();
		var appendBeginMoney = $("#appendMinMoeny").val();
		var appendEndMoney = $("#appendMaxMoeny").val();
 		//按照条件执行查询操作
		$.ajax({
			url : "<%=path%>/creditLmtControl/queryAppendDetailInfoBylimtNo?"+new Date().getTime(),
			type : 'POST',
			async : true,
			data:{
				limitNo:temLimtNo,
				beginTime:beginTime,
				endTime:endTime,
				appendBeginMoney:appendBeginMoney,
				appendEndMoney:appendEndMoney,
				pageIndex:pageIndex
			},
			dataType:'json',
			success:function(data){
				$.closeLoading();
				if($.validate(data))  return;
				if(null != data){//业务处理
					var fieldNames = "SUB_CHANNEL_NAME,APPEND_MONEY,CREATE_TIME,REMARK_DSCP";
					var tableContent = creatTable(fieldNames,data,null);
					var tableObj = $("#appendDetailInfoTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					var strPage = creatChannelPage2(pageIndex,6,data.maxPage,"26");
					var pageDIV = $("#appendDetailInfoPageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					
					$("#appendDetailDiv").OpenDiv();
				}
			}
		});
	}
	//统一 关闭  窗口
	function closeCurrentDIV(obj){
			$("#"+obj).CloseDiv();
			temLimtNo="";
			$("#handelDateBegin").val('');
			$("#handelDateEnd").val('');
			$("#appendMinMoeny").val('');
			$("#appendMaxMoeny").val('');
	}
	function revert(){
		$("#handelDateBegin").val('');
		$("#handelDateEnd").val('');
		$("#appendMinMoeny").val('');
		$("#appendMaxMoeny").val('');
	}
	
	//隐藏"appendMoneyDiv"
	function closeAppendMoneyDiv(){
		$("#appendMoneyDiv").CloseDiv();
		
		$("#appendMoneyTable input[type != 'button']").val("");
		$("#appendMoneyTable font").html("");
		$("#appendMoneyTable #appendMoney").val("0");
		$("#appendMoneyTable #remarkDscp").val("");
		
	}
	
	//点击"新增(creditLmtDef)"
	function addCreditLmtDefDiv(){
// 		loadChannelInfoSelect_addOrUpdateDiv();
		
// 		$("#channelInfoSelectDiv_addOrUpdateDiv").css("display","block");
// 		$("#channelNameRead_addOrUpdateDiv").css("display","none");
		$("#selfOnly").prop("checked", false);
		$('#selfOnly').attr("disabled",true);
		$("#chooseChannelBtn").show();
		$("#addOrUpdateCreditLmtDefDiv").OpenDiv();
	}
	
	//新增(creditLmtDef)层，"请选择(合作伙伴及其子机构)"按钮
	//加载合作伙伴及其子机构(只加载没有“creditLmtDef”的合作伙伴及其子机构)
	function queryChannel(pageIndex){
		$("#BigDiv2").remove();
		var subChannelCodeInput = $.trim($("#subChannelCodeInput").val());
		var subChannelNameInput = $.trim($("#subChannelNameInput").val());
		
		$.openLoading();
		$.ajax({
			url : "<%=path%>/creditLmtControl/queryNotInCreditLmtDefChannelInfo?"+new Date().getTime(),
			type : 'POST',
			async : true,
			data:{
				subChannelCode:subChannelCodeInput,
				subChannelName:subChannelNameInput,
				pageIndex:pageIndex
			},
			dataType:'json',
			success:function(page){
				$.closeLoading();
				if($.validate(page))return;

				var radioObj ="<input class='input_fxk' name='channelradio' type='radio' value=''>";
				var fieldNames = "SUB_CHANNEL_CODE,SUB_CHANNEL_NAME,CHANNEL_NAME,PARENT_CHANNEL_CODE@TDH";
				var tableContent = creatTable1(fieldNames,page,radioObj);
				var tableObj = $("#channelTable");
				tableObj.find("tbody").remove();
				tableObj.append(tableContent);
				
				var strPage = creatChannelPage3(pageIndex,6,page.maxPage,"38");
				var pageDIV = $("#channelPageDIV");
				pageDIV[0].innerHTML="";
				pageDIV.append(strPage);
				
				bindradio();
				
				$('#channelDiv').OpenDiv2();
			}
		});
	}
	
	//
	function closeChannelDiv(){
		$('#channelDiv').CloseDiv2();
	}
	
	//选择一条合作伙伴子机构，点击“确定”
	function chooseChannel(){
		var selectedChannel = $("input[name='channelradio']:checked");
		if(selectedChannel.length==0){
			$.message("error", "请选择一个合作伙伴子机构");
			return;
		}
		var subChannelCode = selectedChannel.parent().parent().children(" td:eq(1)").html();
		var subChannelName = selectedChannel.parent().parent().children(" td:eq(2)").html();
		var parentChannelCode = selectedChannel.parent().parent().children(" td:eq(4)").html();
		
		$("#channelNameRead_addOrUpdateDiv").val(subChannelName);
		$("#channelCodeRead_addOrUpdateDiv").val(subChannelCode);
		if($.trim(parentChannelCode)==""){
			$('#selfOnly').attr("disabled",false);
			if(parentChannelCode=='Y'){
				$("#selfOnly").prop("checked", true);
			}else{
				$("#selfOnly").prop("checked", false);
			}
		}else{
			$('#selfOnly').attr("disabled",true);
		}
		
		closeChannelDiv();
	}
	
	//隐藏"addOrUpdateCreditLmtDefDiv"
	function closeAddOrUpdateCreditLmtDefDiv(){
		$("#addOrUpdateCreditLmtDefDiv").CloseDiv();
		
		$("#channelCodeRead_addOrUpdateDiv").val("");
		$("#channelNameRead_addOrUpdateDiv").val("");
		$("#limitNoRead_addOrUpdateDiv").val("");
		$("#alertLmt").val("0");
		$("#terminalLmt").val("0");
		e_channelCode = "";
		
	}
	
	//点击"修改(creditLmtDef)"
	var e_channelCode="";
	function updateCreditLmtDef(creditLmtDef){
		var limitNo = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[0].innerHTML;
		var channelName = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[1].innerHTML;
		var alertLmt = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[4].innerHTML;
		var terminalLmt = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[5].innerHTML;
		e_channelCode = $(creditLmtDef).parent('td').parent('tr')[0].childNodes[6].innerHTML;
		var parentChannelCode =$(creditLmtDef).parent('td').parent('tr')[0].childNodes[8].innerHTML;
// 		$("#channelInfoSelectDiv_addOrUpdateDiv").css("display","none");
// 		$("#channelNameRead_addOrUpdateDiv").css("display","inline");
		$("#chooseChannelBtn").hide();
		$("#channelNameRead_addOrUpdateDiv").val(channelName);
		$("#limitNoRead_addOrUpdateDiv").val(limitNo);
		$("#alertLmt").val(alertLmt);
		$("#terminalLmt").val(terminalLmt);
		
		if($.trim(parentChannelCode)==""){
			$('#selfOnly').attr("disabled",false);
			if(selfOnly=='Y'){
				$("#selfOnly").prop("checked", true);
			}else{
				$("#selfOnly").prop("checked", false);
			}
		}else{
			$("#selfOnly").prop("checked", false);
			$('#selfOnly').attr("disabled",true);
		}
		
		$("#addOrUpdateCreditLmtDefDiv").OpenDiv();
	}
	
	//点击"保存（creditLmtDef）"
	function saveCreditLmtDef(){
		var alertLmt = $.trim($("#alertLmt").val());
		var terminalLmt = $.trim($("#terminalLmt").val());
		
		if(!isNum(alertLmt)){
			$.message("error", "提示信息额度必须为数字");
			return;
		}
		//定义正则
		var reg = /^-?(0|[1-9]\d*)(\.\d+)?$/;
		if(!reg.test(alertLmt)){
			$.message("error", "提示信息额度格式错误，请修改!");
			return;
		}
		if(!isNum(terminalLmt)){
			$.message("error", "终止交易额度必须为数字");
			return;
		}
		if(!reg.test(terminalLmt)){
			$.message("error", "终止交易额度格式错误，请修改!");
			return;
		}
		var limitNo = $("#limitNoRead_addOrUpdateDiv").val();//“修改”时需要
		if(e_channelCode ==""){
			var channelCode = $("#channelCodeRead_addOrUpdateDiv").val();//“新增”时需要
		}else{
			var channelCode = e_channelCode;
		}
		
		
		if(limitNo == null || limitNo == ""){
			if(channelCode == ""){
				$.message("error", "请选择合作伙伴");
				return;
			}
		}
		var selfOnly = '';
		//如果为选中
		if($("#selfOnly").attr("disabled")== "disabled"){
			selfOnly = '';
		}else{
			if($("#selfOnly").prop("checked")){
				selfOnly='Y';
			}else{
				selfOnly='N';
			}
		}
		$.openLoading();
		$.ajax({
			url : "<%=path%>/creditLmtControl/saveOrUpdateCreditLmtDef?"+new Date().getTime(),
			type : 'POST',
			async : true,
			data:{
				alertLmt:alertLmt,
				terminalLmt:terminalLmt,
				limitNo:limitNo,
				channelCode:channelCode,
				selfOnly:selfOnly
			},
			dataType:'json',
			success:function(data){
				$.closeLoading();
				
				if($.validate(data))  return;
				
				closeAddOrUpdateCreditLmtDefDiv();
				
				queryCreditLmtDef(1);
				
// 				loadChannelInfoSelect_addOrUpdateDiv();
			}
		});
	}
	
	function clearNoNum(event,obj){ 
	    //响应鼠标事件，允许左右方向键移动 
	    event = window.event||event; 
	    if(event.keyCode == 37 | event.keyCode == 39){ 
	        return; 
	    } 
	    //先把非数字的都替换掉，除了数字和. 
	    obj.value = obj.value.replace(/[^\d.]/g,""); 
	    //必须保证第一个为数字而不是. 
	    obj.value = obj.value.replace(/^\./g,""); 
	    
	    if(obj.value.charAt(0) == "0"){
	    	obj.value = obj.value.substr(1);
	    }
	    
	    //保证只有出现一个.而没有多个. 
	    obj.value = obj.value.replace(/\.{2,}/g,"."); 
	    //保证.只出现一次，而不能出现两次以上 
	    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$","."); 
	} 
	function checkNum(obj){ 
	    //为了去除最后一个. 
	    obj.value = obj.value.replace(/\.$/g,""); 
	}
	
	
	//绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
	function bindradio(){
		$("input[name='channelradio']").click(function(){
			$("input[name='channelradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
	}
</script>

</head>

<body>
	<div class="current">
           <table class="current_table_1">
              <tbody><tr class="f2">
                <td><img src="./images/current_1.jpg"></td>
                  <td class="current_table_1_td">
                  <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
                  <span style=" color:#136bab; ">合作伙伴管理
                  <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>额度控制
                  </span>
                  </td>
                  <td><img src="./images/current_3.jpg"></td>
              </tr>
           </tbody></table>
     </div>
	
	<table border="1" class="table_02" style="height:150px">
  		<tr height="50px">
  			<td colspan="2" align="center">
				合作伙伴子机构：&nbsp;<input id="channelName" class="input_text"/>&nbsp;&nbsp;
				<input type="button" class="input_button_1" value="查询" onclick="queryCreditLmtDef(1)"/>
				<input type="button" class="input_button_1"  value="新增" onclick="addCreditLmtDefDiv()"/>
 			</td>
  		</tr>
  		<tr>
  			<td valign="top">
	  			<div style="width:98%;margin:5px" id="creditLmtDefDiv" >
			  		<table class="table_02" id="creditLmtDefTable">
			  		<thead>
		              <tr>
		                  <th style="width:21%">合作伙伴子机构</th>
		                  <th style="width:15%">剩余保费</th>
		                  <th style="width:15%">累计保费</th>
		                  <th style="width:15%">提示信息额度</th>
		                  <th style="width:15%">终止交易额度</th>
		                  <th style="width:20%">操作</th>
		              </tr>
		              </thead>
		              <tbody>
					  </tbody>
                    </table>
	  				 <div id="creditLmtDefPageDIV"  class="page"></div>
	  			</div>
  			</td>
  		</tr>
  	</table>
  	
  	<!-- 新增或编辑"信用额度"层 -->
  	 <div id="addOrUpdateCreditLmtDefDiv" style="display:none;width: 600px;margin-top: -50px">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeAddOrUpdateCreditLmtDefDiv()"/></td>
					</tr>
				</table>
		</div>
		<table class="table_02" id="addOrUpdateCreditLmtDefTable" style="height:120px; width: 92%;" align="center" >
			<tr>
				<td style="text-align: right;border-right: 0">合作伙伴子机构：</td>
				<td style="text-align: left;">
<!-- 					<div id="channelInfoSelectDiv_addOrUpdateDiv"><select id="channelInfoSelect_addOrUpdateDiv" style="width: 200px"><option value="">--请选择--</option></select></div> -->

					<input class="input_text" id="channelNameRead_addOrUpdateDiv"  style="width: 200px;background: #ccc" readonly="readonly"/>
					<input type="hidden" id="channelCodeRead_addOrUpdateDiv"/>
					<input type="button"  class="input_button_2" id="chooseChannelBtn" value="请选择" onClick="queryChannel(1)"/>
					<input type="hidden" id="limitNoRead_addOrUpdateDiv"/>
					<input id="selfOnly" type="checkbox" disabled="disabled" style="margin-left: 10px" />&nbsp;仅控制本部
				</td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0">提示信息额度：</td>
				<td style="text-align: left;"><input id="alertLmt" value="0" class="input_text" style="text-align: right;width: 200px" maxlength="15" />&nbsp;<span style="color: red">*</span></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0">终止交易额度：</td>
				<td style="text-align: left;"><input id="terminalLmt" value="0" class="input_text" style="text-align: right;width: 200px" maxlength="15" />&nbsp;<span style="color: red">*</span></td>
			</tr>
		</table>
		<div id="mybutton" style="height:25px;width: 92%;" align="center" >
		   <input type="button" id="saveMenuBtn" value="保存" onclick="saveCreditLmtDef()" class="input_button_1"/>&nbsp;&nbsp;&nbsp;
		   <input type="button" value="取消" onclick="closeAddOrUpdateCreditLmtDefDiv()" class="input_button_1"/>
		</div>
	</div>
  	
  	<!--选择"合作伙伴及其子机构"层           默认隐藏 -->
 	<div id="channelDiv"  style="display:none;width:80%">
		<div class="table_title_div">
			<table class="table_title" style='width:100%;height:20px;'>
				<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeChannelDiv()"/></td>
				</tr>
			</table>
		</div>
		
		<table class="table_02" align="center" style="width: 95%" >
			<tbody>
				<tr>
					<td>
						<!-- 筛选条件层 -->
						<table class="search_table">
							<tr>
								<td style="text-align:center">
									合作伙伴子机构代码：<input id="subChannelCodeInput" class="input_text" value="">&nbsp;&nbsp;
									合作伙伴子机构名称：<input id="subChannelNameInput" class="input_text" value="">&nbsp;&nbsp;
									<input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryChannel(1)"/>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table id="channelTable"  class="content_table_1">
							<thead>
								<tr class="f1">
				                  <th style="width:5%">选择</th>
				                  <th style="width:25%">合作伙伴子机构代码</th>
				                  <th style="width:35%">合作伙伴子机构名称</th>
				                  <th style="width:35%">所属合作伙伴</th>
				              	</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
						<div id="channelPageDIV" class="page">
						</div>
					</td>
				</tr>
			</tbody>
		</table>
		<div align="center" >
		 <input class="input_button_3" type="button" onclick="chooseChannel()" value="确定">&nbsp;&nbsp;
         <input class="input_button_3" type="button" onclick="closeChannelDiv()" value="取消">
		</div>
   </div>
  	
    <div id="appendMoneyDiv" style="display:none;width: 550px;padding: 0px;margin-top: -50px;overflow-y:auto;">
		<div class="table_title_div" >
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeAppendMoneyDiv()"/></td>
					</tr>
				</table>
		</div>
		<table class="table_02" id="appendMoneyTable" style="height:170px;width: 92%;" align="center" >
			<input id="channelCode_appendMoney" type="hidden"/>
			<input id="limitNo_appendMoney" type="hidden"/>
			<tr>
				<td style="text-align: right;border-right: 0px; width: 30%;">合作伙伴：</td>
				<td style="text-align: left;"><input class="input_text" style="background: #ccc;width: 200px" readonly="readonly" id="channelName_appendMoney" /></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0px;width: 30%;">提示信息额度：</td>
				<td style="text-align: left;"><input class="input_text" style="background: #ccc;width: 200px" readonly="readonly" id="alertLmt_appendMoney" /></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0px;width: 30%;">终止交易额度：</td>
				<td style="text-align: left;"><input class="input_text" style="background: #ccc;width: 200px" readonly="readonly" id="terminalLmt_appendMoney" /></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0px;width: 30%;">当前剩余保费：</td>
				<td style="text-align: left;"><input class="input_text" style="background: #ccc;width: 200px" readonly="readonly" id="saveMoney_appendMoney" /></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0px;width: 30%;">追加保费：</td>
				<td style="text-align: left;"><input id="appendMoney" value="0" class="input_text" style="text-align: right;width: 200px" onKeyUp="clearNoNum(event,this)" onBlur="checkNum(this)"/>&nbsp;<span style="color: red">*</span></td>
			</tr>
			<tr>
				<td style="text-align: right;border-right: 0px;width: 30%;">备注说明：</td>
				<td style="text-align: left;"><textarea name="remarkDscp" id="remarkDscp"  rows="5" class="textarea_1" style="width: 320px;"></textarea>&nbsp;<span style="color: red">*</span></td>
			</tr>
		</table>
		<div style="width: 92%;" align="center" >
		    <input type="button" id="saveBtn"  class="input_button_3"  value="保存" onclick="saveAppendMoney()"/>
			<input type="button" value="取消"  class="input_button_3"  onclick="closeAppendMoneyDiv()"/>
		</div>
	</div>
	
	<!--追加明细层   默认隐藏-->
  	<div id="appendDetailDiv"  style="display:none;width:80%; margin-top:10px;">
			<input type="hidden" id="row_num" name="row_num" value="0"/>
				<div class="table_title_div">
					<table class="table_title" style='width:100%;height:20px;'>
						<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('appendDetailDiv')"/></td>
						</tr>
					</table>
				</div>
	
			<!-- 修改id 名 -->
			<table class="table_02" id="addtempletTable" align="center" >
				<tbody>
				<tr>
				<td>
					<table class="search_table">
					<tr align="center">
							<td style="border:0px;text-align: right; width: 35%;">操作日期：</td>
							<td style="border:0px;text-align: left;">
								<input id="handelDateBegin" onkeydown="false" onclick="showCalendar('handelDateBegin','y-mm-dd');$('.calendars').css('z-index',20000);" class="input_time" type="text" style="width:130px;"/>
								 &nbsp;至 &nbsp;
								<input id="handelDateEnd" onkeydown="false" onclick="showCalendar('handelDateEnd','y-mm-dd');$('.calendars').css('z-index',20000);" class="input_time" type="text" style="width:130px;"/>
							</td>
					</tr>
					<tr>
							<td style="border:0px;text-align: right;width: 35%;">追加金额：</td>
							<td style="border:0px;text-align: left;">
							<input id="appendMinMoeny"  type="text" class="input_text" value="" style="width:130px;" onKeyUp="clearNoNum(event,this)" onBlur="checkNum(this)">
							 &nbsp;至&nbsp;&nbsp;
							<input id="appendMaxMoeny"  type="text" class="input_text" value="" style="width:130px;" onKeyUp="clearNoNum(event,this)" onBlur="checkNum(this)">
					</tr>
					<tr>
							<td colspan="2" style="border:0px;text-align: center; padding-top: 10px;">
							<input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryAppendDetail(1)"/>
							<input type="button"  class="input_button_1" id="resetBtn" value="重置" onClick="revert()"/></td>
							
					</tr>
				</table>
				</td></tr>
					<tr>
						<td>
							<!-- 修改数据table名 -->
							<table id="appendDetailInfoTable"  class="content_table_1">
								<thead>
									<tr class="f1">
					                  <th style="width:25%">合作伙伴</th>
					                  <th style="width:15%">追加金额</th>
					                  <th style="width:15%">操作日期</th>
					                  <th style="width:45%">备注说明</th>
					              	</tr>
								</thead>
								<!-- 修改tobody 默认为空 -->
								<tbody>
								</tbody>
							</table>
							<!-- 修改分页编码id 名  默认为空-->
							<div id="appendDetailInfoPageDIV" class="page">
							</div>
						</td>
					</tr>
				</tbody>
			</table>
	   </div>
</body>
</html>